package com.fay.mymiaosha.service;

import com.fay.mymiaosha.exception.BizException;
import com.fay.mymiaosha.service.model.ItemModel;

import java.util.List;

/**
 * @Title:
 * @Description:
 * @Author Fay Wang
 * @Date 2022/3/17 20:48
 * @Version 1.0
 */
public interface IItemService {

    List<ItemModel> listItems();

    ItemModel getItemById(Integer id);

    ItemModel createItem(ItemModel itemModel) throws BizException;
    // 增加商品销量 itemId amount
    void increaseSales(Integer itemId, Integer amount) throws BizException;
    // 减去库存 itemId amount
    boolean decreaseStock(Integer itemId, Integer amount);
}
